<?php
namespace Plugin\Attractions\Commerce\Schema\Commerce_commodity_type;

use Plugin\Attractions\Commerce\Model\Commerce_commodity_type\CommerceCommodityType;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 商品类型
 */
#[Schema(title: 'CommerceCommodityTypeSchema')]
class CommerceCommodityTypeSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: '主键ID', type: 'bigint')]
    public string $id;

    #[Property(property: 'name', title: '商品类型名称', type: 'varchar')]
    public string $name;

    #[Property(property: 'description', title: '商品类型描述', type: 'varchar')]
    public string $description;




    public function __construct(CommerceCommodityType $model)
    {
       $this->id = $model->id;
       $this->name = $model->name;
       $this->description = $model->description;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'name' => $this->name ,'description' => $this->description];
    }
}